$(function () {
    var bar = Window.AppBar = {
        downloadUrl: 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yzjy.yizhijiaoyu',
        appInfo: {
            name: '艺点点',
            slogan: '现在点击下载艺点点即可在线报名哦',
            logo: 'http://contest.yddkt.com/images/logo-800.jpg'
        },
        run: function () {
            var me = this;
            var html = '<style type="text/css">.app-bar{display:block;position:fixed;left:0;bottom:0;width:100%;height:55px;background:rgba(0, 0, 0, .7);color:#FFF;z-index:10001;font-size:12px;font-family:"Microsoft Yahei";}.app-bar .app-logo{float:left;width:35px;height:35px;padding:8px 0 0 5px;}.app-bar .app-txt{float:left;padding:7px 0 0 8px;line-height:16px;}.app-bar .app-txt h2{font-weight:normal;font-size:15px;}.app-btn{float:right;background-color:#4998E7;border-radius:3px;height:16px;padding:8px 5px;margin:6px 10px 0 0;color:#FFF;}.app-close{float:right;width:1px;height:12px;background-size:100%;margin:16px 5px 0 0;}.app-txt h2,p{margin: 0;padding: 0}</style><div id="app-bar" class="app-bar"><div class="app-logo"><img width="100%" src="' + me.appInfo.logo + '" alt="logo"></div><div class="app-txt"><h2>' + me.appInfo.name + "</h2><p>" + me.appInfo.slogan + '</p></div><div class="app-close"></div><div class="app-btn"></div></div>';
            $("body").append(html);

            me.showBar();
            me.downloadApp();
            //me.close();

        },
        downloadApp: function () {
            var me = this;
            $("#app-bar .app-btn").html("立即下载");
            $("#app-bar .app-btn").on("click", function () {
                location.href = me.downloadUrl
            });
        },
        close: function () {
            $("#app-bar .app-close").on("click", function () {
                $("#app-bar").hide();
            });
        },
        showBar: function () {
            $("#app-bar").show();
        }
    };
    bar.run();
});